package cn.common.exception;

public enum DefaultError implements IError {
    /**
     * 业务异常
     */
    BUSINESS_ERROR("0001", "业务异常"),
    /**
     * 授权失败 禁止访问
     */
    ACCESS_DENIED("0015", "没有访问权限"),
    /**
     * 不支持的content类型
     */
    CONTENT_TYPE_NOT_SUPPORT("0009", "不支持的content类型"),
    METHOD_NOT_SUPPORTED("0008", "请求方法出错"),
    INVALID_PARAMETER("0007","请求体格式错误"),
    MISSING_PARAM("0006","请求缺少必要参数"),
    SQL_EXCEPTION("0005","服务运行错误"),
    NULL_EXCEPTION("0004","空指针异常"),
    TIMEOUT_EXCEPTION("00016","连接响应失败")
    ;
    private static final String NS = "SYS";
    String code;
    String message;
    DefaultError(String code, String message) {
        this.code = code;
        this.message = message;
    }
    @Override
    public String getCode() {
        return NS+code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public void setMessage(String message) {
          this.message = message;
    }


}
